package co.liyao.service.impl;

import co.liyao.mapper.BizCommentMapper;
import co.liyao.model.BizArticle;
import co.liyao.model.BizComment;
import co.liyao.service.MessageService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MessageServiceImpl implements MessageService {
    @Autowired
    private BizCommentMapper mapper;

    @Override
    public int save(BizComment com) {
        int i = mapper.insert(com);
        return i;
    }

    @Override
    public PageInfo<BizComment> findAll(Integer pageNum) {
        PageHelper.startPage(pageNum,10);

        List<BizComment> biz =  mapper.findAll();
        PageInfo<BizComment>  page= new PageInfo<BizComment>(biz);
            page.setList(biz);
        return page;
    }

    @Override
    public int findCount() {
        return mapper.findCount();
    }

    @Override
    public int findlike() {
        return mapper.findLike();
    }
}
